package com.hisysteTopet.hisystepet.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hisysteTopet.hisystepet.bean.Pet;
import com.hisysteTopet.hisystepet.mapper.PetMapper;
import com.hisysteTopet.hisystepet.service.PetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PetServiceImpl extends ServiceImpl<PetMapper, Pet> implements PetService {

    @Autowired
    PetMapper petMapper;

    @Override
    public List<Pet> findAll() {
        return petMapper.findAll();
    }

    @Override
    public void updateToPetNum(Integer petNumber, Integer petId) {
        petMapper.updateToPetNum(petNumber, petId);
    }

    public Pet selectToPetId(Integer petId){
       return petMapper.selectToPetId(petId);
    }

    @Override
    public void updatePetMessage(Pet pet) {
        petMapper.updatePetMessage(pet);
    }

    @Override
    public void deletePetMessageById(String petId) {
        petMapper.deletePetMessageById(petId);
    }

    @Override
    public void updateToPetNumByAdmin(Integer petNumber, Integer petId) {
        petMapper.updateToPetNumByAdmin(petNumber,petId);
    }

    @Override
    public void insertPet(String petName, String variety, String url, String introduce, Integer price, Integer num) {
        petMapper.insertPet(petName,variety,url,introduce,price,num);
    }


}
